package com.kangkang.leetcode30;

import java.util.Arrays;
import java.util.Scanner;

public class Test392 {
    private static boolean isSubsequence(String s, String t) {
        if (s.length() == 0) {
            return true;
        }
        int j = 0;//子
        int i = 0;
        while (i < t.length()) {
            if (s.charAt(j) == t.charAt(i)) {
                j++;
            }
            i++;
            if (j >= s.length()) {
                return true;
            }
        }
        return false;
    }

    private static int test() {
        int a = 1;
        int result = 0;
        while (a <= 100) {
            if(a%7==0||a%10==7||a/10==7){
                System.out.print('过'+" ");
            }else{
                System.out.print(a+" ");
            }
            a++;
        }
        return result;
    }
    //三角形
    private static int[] test3(int n,int[] arr){
        int tag = 0;
        for (int i = 0; i < arr.length; i++) {
            if(tag>0){
                arr[i-tag]=arr[i];
            }
            if(n==arr[i]){
                tag++;
            }
        }
        return Arrays.copyOfRange(arr, 0, arr.length-tag);
    }

    private static void test2() {
        Scanner scanner = new Scanner(System.in);
        System.out.println("你输入的是" + scanner.nextInt());
    }

    public static void main(String[] args) {
        //Test392.test2();
        //test();
        int[] arr = {3,4,6,9,7,9,9,10};

        System.out.println(Arrays.toString(test3(9, arr)));
    }
}
